package models

import (
	"time"
)

type User struct {
	Id        uint32    `gorm:"column:id;type:int UNSIGNED;primaryKey;not null;" form:"id" json:"id"`
	Mobile    string    `gorm:"column:mobile;type:char(11);comment:手机号;not null;" form:"mobile" json:"mobile"`                              // 手机号
	Password  string    `gorm:"column:password;type:char(32);comment:密码;not null;" form:"password" json:"password"`                          // 密码
	Image     string    `gorm:"column:image;type:varchar(500);comment:头像;not null;" form:"image" json:"image"`                               // 头像
	Status    int8      `gorm:"column:status;type:tinyint(1);comment:用户状态  0:正常 1:冻结;not null;default:0;" form:"status" json:"status"` // 用户状态  0:正常 1:冻结
	CreatedAt time.Time `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" form:"created_at" json:"created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" form:"updated_at" json:"updated_at"`
	DeletedAt time.Time `gorm:"column:deleted_at;type:datetime(3);default:NULL;" form:"deleted_at" json:"deleted_at"`
}

func (u User) TableName() string {
	return "user"
}
